home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / warp_tunnel / warp_tunnel.dba < prev    next >
Encoding:
Text File  |  2000-03-31  |  1.5 KB  |  86 lines

  1. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2. `              Warp Tunnel
  3. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4. ` By Rich Davey (rich@fatal-design.com)
  5. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  6. ` Fly and spin down a warp tunnel! Easy
  7. ` effect  but  looks  really  effective 
  8. ` with a good texture.
  9. `
  10. ` Music listened  to while  coding this
  11. ` The Beach soundtrack.
  12. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  13.  
  14. sync rate 60
  15. sync on
  16. hide mouse
  17.  
  18. `    128x128 texture
  19. `    Change to "lava.bmp" for a different effect
  20.  
  21. load image "plasma.bmp",1
  22.  
  23. `    Music
  24.  
  25. load music "rom.mid",1
  26.  
  27. `    Create 2 copies of this texture as bitmap 1 then grab it to image 2
  28.  
  29. create bitmap 1,128,256
  30. set current bitmap 1
  31. paste image 1,0,0
  32. paste image 1,0,128
  33.  
  34. `    Set drawing back to the screen
  35.  
  36. set current bitmap 0
  37. create bitmap 2,128,128
  38.  
  39. `    Lets make our tunnel
  40.  
  41. make object cylinder 1,100
  42. rotate object 1,270,0,270
  43. fix object pivot 1
  44. scale object 1,100,100,2500
  45. texture object 1,1
  46. set object 1,1,0,0
  47.  
  48. `    Hide the end of the cylinder
  49.  
  50. make object sphere 2,100
  51. color object 2,rgb(0,0,0)
  52. position object 2,0,0,1000
  53.  
  54. color backdrop rgb(0,0,0)
  55.  
  56. position camera 0,0,-1250
  57.  
  58. `    Change to alter speed of zoom
  59.  
  60. speed=1; limit=1; counter=0
  61. play music 1
  62.  
  63. `    Main Loop
  64.  
  65. do
  66.  
  67.     if counter=limit
  68.         set current bitmap 1
  69.         get image 2,0,y,128,y+128
  70.         set current bitmap 2
  71.         paste image 2,0,0
  72.         set current bitmap 0
  73.         texture object 1,2
  74.         inc y
  75.         if y=128 then y=0
  76.         counter=0
  77.     endif
  78.  
  79.     z=z+speed; zrotate camera wrapvalue(z)
  80.     inc counter
  81.  
  82.     sync
  83.     
  84. loop
  85.  
  86.